package com.canto.wanna.user.pojo.converter;

import com.canto.wanna.user.pojo.entity.User;
import com.canto.wanna.user.pojo.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * User相关对象转换
 *
 * @Author jsryin
 * @Date 2021/7/27 23:02
 */
@Mapper
public interface UserConverter {

    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);

    @Mappings({
            @Mapping(source = "code", target = "userCode"),
            @Mapping(source = "name", target = "userName")
    })
    UserVO do2vo(User userDO);

}
